#include <cstdio>
#include <cstring>
#include <cassert>
#include <cstdlib>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <numeric>
#include <list>
#include <queue>
#include <iostream>
#include <limits>
#include <string>
using namespace std;
#define forr(a, b) for (int a = 0; a < b; ++a)
#define eps 1e-9
#define inf 1e9
#define pb push_back
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vint;
template<class T>  T gcd(T a, T b){return b?gcd(b,a%b):a;}
int get(string a){
    if (a.length() == 1){
        if (a == "C")
            return 0;
        else if (a=="D")
            return 2;
        else if (a=="E")
            return 4;
        else if (a=="F")
            return 5;
        else if (a=="G")
            return 7;
        else if (a=="A")
            return 9;
        else if(a=="B")
            return 10;
        else if (a=="H")
            return 11;
    }
    else{
        string temp;
        temp += a[0];
        return get(temp) + 1;

    }
    return inf;
}
int main(){
    string a,b, c;
    cin>>a>>b>>c;
    int A[] = {get(a),get(b),get(c)};
    sort(A,A+3);
    do{
    if ((A[1]-A[0]==4 && A[2]-A[1]==3) || (A[1]-A[0]==3 && A[2]-A[1]==5) || (A[1]-A[0]==5 && A[2]-A[1]==4)){
        cout<<"major";
        return 0;
    }
    if ((A[1]-A[0]==3 && A[2]-A[1]==4)||(A[1]-A[0]==4 && A[2]-A[1]==5)||(A[1]-A[0]==5 && A[2]-A[1]==3)){
        cout<<"minor";
        return 0;
    }
       
    }while(next_permutation(A,A+3));
    cout<<"strange";
    return 0;
}